Skip to content

[201_95] Disable command mode autocomplete suggestions in macro editor#2953

Merged
wumoin merged 8 commits intoMoganLab:mainfrom
1sh-repalto:1sh-repalto/201_86/disable_macro_editor_autocomplete
Mar 11, 2026
Merged

[201_95] Disable command mode autocomplete suggestions in macro editor#2953
wumoin merged 8 commits intoMoganLab:mainfrom
1sh-repalto:1sh-repalto/201_86/disable_macro_editor_autocomplete

Conversation

@1sh-repalto
Copy link
Contributor

@1sh-repalto 1sh-repalto commented Mar 7, 2026

Fixes #2873
In the macro editor, the autocomplete suggestions in command mode ⟨\⟩ should be disabled.

Summary

Disabled the autocomplete popup suggestions in the macro editor while keeping the \ hybrid command mode functional.

Issue Found

When editing macros in the macro editor, typing \ would trigger the command mode ⟨\⟩ with a popup of autocomplete suggestions.

Changes

Modified src/Edit/Interface/edit_source.cpp:

// Disable autocomplete options in the macro editor
string buf_name= as_string (buf->buf->name);
if ((starts (buf_name, "tmfs://aux/edit-") &&
     buf_name != "tmfs://aux/edit-shortcuts" &&
     !starts (buf_name, "tmfs://aux/edit-comment")) ||
    buf_name == "tmfs://aux/macro-editor") {
  return;
}

How to test

  1. Open Mogan Editor.
  2. Open the macro editor via Tools → Macros → New macro or Edit macros.
  3. Press the \ key and begin typing.
  4. Verify:
    • The ⟨\⟩ bracketed tag (hybrid command mode) appears correctly.
    • No autocomplete suggestion popup appears while typing.
  5. Test in a normal document:
    • Verify: The \ key triggers the hybrid command mode completely, and autocomplete functions as normal.
  6. Test in search/replace window:
    • Verify: The \ key triggers the hybrid command mode completely, and autocomplete functions as normal.
disable_auto_complete_suggestions.mp4

@wumoin
Copy link
Contributor

wumoin commented Mar 9, 2026

What is needed is to disable the entire \ command behavior.

@1sh-repalto
Copy link
Contributor Author

Thank you for the clarification @wumoin! I had asked about this in comments as well as in discord but didn't receive any response so just went with this approach. I'll update the PR asap.

…acro editor, updated developer document devel/201_94.md
@1sh-repalto
Copy link
Contributor Author

Hello @wumoin, I have refactored the logic and also updated the developer document as well as the PR body. Please review when you have time.

@1sh-repalto 1sh-repalto changed the title [201_94] Disable command mode autocomplete suggestions in macro editor [201_95] Disable command mode autocomplete suggestions in macro editor Mar 10, 2026
@wumoin wumoin merged commit 1b36083 into MoganLab:main Mar 11, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

宏编辑器中应该禁用命令模式 \ 的补全选项

2 participants